﻿<!DOCTYPE html>
<html lang="zh">
<head>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="CurrData.Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <title>Index </title>
    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />

    <link href="/js/kd/styles/kendo.common.min.css" rel="stylesheet" />
    <link href="/js/kd/styles/kendo.blueopal.min.css" rel="stylesheet" />
    <link href="/js/fa/css/font-awesome.min.css" rel="stylesheet" />
    <link href="/js/site.css?t=20221031" rel="stylesheet" />

    <script src="/js/kd/jquery.min.js"></script>
    <script src="/js/kd/kendo.web.min.js"></script>

    <script src="/js/kd/cultures/kendo.culture.zh-CN.min.js"></script>
    <script src="/js/kd/messages/kendo.messages.zh-CN.min.js"></script>
    <script src="/js/kd/jszip.min.js"></script>


    <script src="/js/kendo_stdefine.js"></script>
    <script src="/js/site50.js"></script>
    <script src="/js/xlsx.full.min.js?t=1"></script>


</head>
<body>

    <div id="divSplitter" data-role="splitter"
         data-panes="[
                { collapsible: false, resizable: false },
                { collapsible: false, resizable: false,  size: '50px' }
             ]"
         data-orientation="vertical"
         >

        <div id="center" style="overflow:hidden;padding-top:0px;overflow-y: auto;">

            <form id="form1">
                <div style="height:10px;"></div>


                <div class="flexrow">
                    <div class="tdLabel75 Required">主机号</div>
                    <div class="tdValue">

                        <input id="HostId" name="HostId" required
                               style="width:150px;"
                               data-role="numerictextbox"
                               data-min="1"
                               data-max="255"
                               data-format="N0"
                               data-bind="value:m.HostId" />

                    </div>
                    <div style="width:20px;"></div>
                </div>

                <div class="flexrow">
                    <div class="tdLabel75 Required">请求等待毫秒</div>
                    <div class="tdValue">

                        <input id="WaitMs" name="WaitMs" required
                               style="width:150px;"
                               data-role="numerictextbox"
                               data-min="50"
                               data-max="1000"
                               data-format="N0"
                               data-bind="value:m.WaitMs" />

                    </div>
                    <div style="width:20px;"></div>
                </div>

                <div class="flexrow">
                    <div class="tdLabel75 Required">请求等待次数</div>
                    <div class="tdValue">

                        <input id="WaitTimes" name="WaitTimes" required
                               style="width:150px;"
                               data-role="numerictextbox"
                               data-min="1"
                               data-max="10"
                               data-format="N0"
                               data-bind="value:m.WaitTimes" />

                    </div>
                    <div style="width:20px;"></div>
                </div>

                

            </form>

            <div style="height:10px;"></div>
            <div id="grid" style="height: calc(100% - 125px)"></div>

        </div>

        <div id="bottom" class="flexrow" style="  ">

            <div style="flex:1;">


            </div>
            <div style="width:100px;" >
                <a href="javascript:btnOKonClick();" class="k-button" style="width:80px; " accesskey="S">
                    
                    <i class="fa fa-save"></i>
                    <span style="text-decoration:underline;margin-left:5px;">S</span>
                    确定
                </a>
            </div>
            <div style="width:80px;">
                <a href="javascript:myWindowClose();" class="k-button" style="width: 80px;  " accesskey="C">
                    <i class="fa fa-close"></i>
                    <span style="text-decoration: underline; margin-left: 5px;">C</span>
                    取消

                </a>
            </div>
            <div style="width:20px;"></div>
           
        </div>

    </div>



        <script>
            var IsAdd = false;
            var viewModel = new kendo.data.ObservableObject({
              
                m: {
                    Id: "0",
                    Name: "",
                    ShortName: "",
                    Memo: "",
                },
               
            });
            var grid;
             

            function Init() {
                $("#form1").kendoValidator(kendoValidatorOptions)
            
                kendo.bind($("#divSplitter"), viewModel); 

                var opt = Object.assign({}, gridBaseOption);
                opt.editable = true;
                opt.columns = [
                    
                    {
                        title: '参数名称', field: "Name", width: 100, sortable: false, filterable: false,
                        editable: () => { return false; }

                    },
                    {
                        title: '参数值', field: "Value", width: 100, sortable: false, filterable: false,
                        editable: (row) => {
                            return true;
                        } 
                    },

                     

                ]
                grid = $("#grid").kendoGrid(opt).data("kendoGrid");

            }
            function btnOKonClick() {

                var v = $("#form1").data("kendoValidator");
                if (v.validate() == false) return;

                var ds = grid.dataSource;
                var data = ds.data();

                viewModel.m.ZSBCS = data;

                onOk(viewModel.m.toJSON() );
            }
            function setData(data) {
                viewModel.set("m", data.m);

                var dsoptions = {
                    schema: {
                        model: {
                            id: "Id",
                            fields: {
                                Id: { editable: false, nullable: true },
                                Value: { editable: true, nullable: false, type: "number" }
                            },

                        }
                    },
                    data: data.m.ZSBCS,
                };
                var gridDataSource = new kendo.data.DataSource(dsoptions);
                grid.setDataSource(gridDataSource);
                gridDataSource.read();

            }

        </script>
        <script>
            var SizeInfo;
            $(function () {

                kendo.culture("zh-CN");


                if (window.Init) {
                    Init();
                }
            });
            function After50(d) {
                if (d) {
                    setTimeout(function () { d(); }, 50);
                }
            }
        </script>
</body>
</html>
